package com.youhp.spire.xls.demo.Worksheets;

import com.spire.xls.*;

public class SetViewMode {
    public static void main(String[] args) {
        String inputFile = "data/ExcelSampleN.xlsx";
        String outputFile = "output/SetViewMode_out.xlsx";

        //Create a workbook and load a file
        Workbook workbook = new Workbook();
        workbook.loadFromFile(inputFile);

        //Set the view mode
        workbook.getWorksheets().get(0).setViewMode(ViewMode.Preview);

        //Save the Excel file
        workbook.saveToFile(outputFile, ExcelVersion.Version2010);
    }
}
